/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ComponenteEntidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Marilyn
 */
@Entity
@Table(name = "tipocombustible")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tipocombustible.findAll", query = "SELECT t FROM Tipocombustible t"),
    @NamedQuery(name = "Tipocombustible.findByIdTipoCombustible", query = "SELECT t FROM Tipocombustible t WHERE t.idTipoCombustible = :idTipoCombustible"),
    @NamedQuery(name = "Tipocombustible.findByTcombTipo", query = "SELECT t FROM Tipocombustible t WHERE t.tcombTipo = :tcombTipo"),
    @NamedQuery(name = "Tipocombustible.findByTcombDescripcion", query = "SELECT t FROM Tipocombustible t WHERE t.tcombDescripcion = :tcombDescripcion")})
public class Tipocombustible implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idTipoCombustible")
    private Integer idTipoCombustible;
    @Size(max = 100)
    @Column(name = "tcomb_Tipo")
    private String tcombTipo;
    @Size(max = 200)
    @Column(name = "tcomb_Descripcion")
    private String tcombDescripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tipocombustible", fetch = FetchType.LAZY)
    private List<Bus> busList;

    public Tipocombustible() {
    }

    public Tipocombustible(Integer idTipoCombustible) {
        this.idTipoCombustible = idTipoCombustible;
    }

    public Integer getIdTipoCombustible() {
        return idTipoCombustible;
    }

    public void setIdTipoCombustible(Integer idTipoCombustible) {
        this.idTipoCombustible = idTipoCombustible;
    }

    public String getTcombTipo() {
        return tcombTipo;
    }

    public void setTcombTipo(String tcombTipo) {
        this.tcombTipo = tcombTipo;
    }

    public String getTcombDescripcion() {
        return tcombDescripcion;
    }

    public void setTcombDescripcion(String tcombDescripcion) {
        this.tcombDescripcion = tcombDescripcion;
    }

    @XmlTransient
    public List<Bus> getBusList() {
        return busList;
    }

    public void setBusList(List<Bus> busList) {
        this.busList = busList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipoCombustible != null ? idTipoCombustible.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tipocombustible)) {
            return false;
        }
        Tipocombustible other = (Tipocombustible) object;
        if ((this.idTipoCombustible == null && other.idTipoCombustible != null) || (this.idTipoCombustible != null && !this.idTipoCombustible.equals(other.idTipoCombustible))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ComponenteEntidad.Tipocombustible[ idTipoCombustible=" + idTipoCombustible + " ]";
    }
    
}
